<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld/" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld/" prefix="html"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>

<%@ page import = "ar.pmt.vista.utils.*" %>
<%@ page import = "java.io.PrintWriter" %>
<%@ page import = "org.apache.commons.collections.SortedBag" %>


<div class="centerContent">
<h1><bean:message key="pmt.eva.analisisDeValorGanado" /></h1>

<h3><bean:write name="controlAvance" property="nombreProyectoSel"/>/<bean:write name="controlAvance" property="nombrePeticionSel"/>/<bean:write name="controlAvance" property="nombreRecursoSel"/>  </h3>

<div id="tableContainer" class="tableContainer" style="width: 280px; display: inline;
   float: left;">
   <display:table name="EVAs"
                  export="false"
                  class="scrollTable displayTable"
                  id="currentRecurso"
                  style="margin: 0px; width:100%"
                  pagesize="1000"
                  defaultorder="descending"
                  decorator="ar.pmt.vista.decoradores.Wrapper">
      <display:caption class="bggris bold">
         <bean:message key="pmt.eva.acumulativo" />
      </display:caption>

      <display:column property="fecha"
                      titleKey="pmt.eva.dia"
                      class="bold verdeTitle"
                      decorator="ar.pmt.vista.decoradores.ShortDateWrapper"
                      style="text-align:center;" />

      <display:column property="estimado"
                      headerClass="azul"
                      titleKey="pmt.eva.costoPlanificado"
                      decorator="ar.pmt.vista.decoradores.DecimalWrapper"
                      style="text-align:right;" />

      <display:column property="incurrido"
                      headerClass="rojo"
                      style="text-align:right;"
                      titleKey="pmt.eva.costoReal"
                      decorator="ar.pmt.vista.decoradores.DecimalWrapper"
                      media="html" />

      <display:column property="avance"
                      headerClass="verde"
                      style="text-align:center;"
                      titleKey="pmt.eva.valorGanado"
                      decorator="ar.pmt.vista.decoradores.DecimalWrapper"
                      media="html" />
   </display:table>
</div>

<%
   String filename = ChartUtils.generateEVAChart(session, new PrintWriter(out), (SortedBag)request.getAttribute("EVAs"));
   String graphURL = request.getContextPath() + "/servlet/DisplayChart?filename=" + filename;
%>

<img src="<%= graphURL %>" class="evaGraph" usemap="#<%= filename %>">
</div>


